package com.hjwoo.app.utils;

import android.content.Context;

import com.hjwoo.app.common.LoanApplication;

/**
 * 封装Toast
 */
public class LoanToast
{
    static Context context;
    private static android.widget.Toast toast = null;

    public LoanToast()
    {
        context = LoanApplication.getInstance().getApplicationContext();
    }

    /**
     * 短
     *
     * @param text
     */
    public static void showToastShort(String text, Context context)
    {
        LoanToast.context = context;

        if (toast == null)
        {
            toast = android.widget.Toast.makeText(context, text, android.widget.Toast.LENGTH_SHORT);
        }
        else
        {
            toast.setText(text);
        }
        toast.show();
    }

    /**
     * 长
     *
     * @param text
     */
    public static void showToastLong(String text, Context context)
    {

        LoanToast.context = context;

        if (toast == null)
        {
            toast = android.widget.Toast.makeText(context, text, android.widget.Toast.LENGTH_LONG);
        }
        else
        {
            toast.setText(text);
        }
        toast.show();
    }

}
